import java.util.Random;
import java.util.Scanner;
import java.util.Calendar;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {

    /**
     * JAVA33 掷骰子游戏
     * @param args
     */
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int seed = scanner.nextInt();
            Random random = new Random(seed);

            //write your code here......
            System.out.println(random.nextInt(6)+1);

        }
    }

    /**
     * JAVA34 求绝对值，平方根，对数，正弦值
     * @param args
     */
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        double num = scanner.nextDouble();

        //write your code here......
        System.out.println(Math.abs(num));//绝对值
        System.out.println(Math.sqrt(num));//平方根
        System.out.println(Math.log(num));//对数
        System.out.println(Math.sin(num));//正弦值


    }

    /**
     * JAVA35 输出某一年的各个月份的天数
     * @param args
     */

    public static void main3(String[] args) {
        Scanner console = new Scanner(System.in);
        int year = console.nextInt();

        //write your code here......
        int[] day = {0,31,28,31,30,31,30,31,31,30,31,30,31,0};//平年；
        if ((year % 4 == 0) && (year % 100 !=0) ||( year % 400 == 0)){
            day[2] = 29;

        }
        for (int i = 1;i<=12;i++){
            System.out.println(year+"年"+i+"月:"+day[i]+"天");
        }

    }


    /**
     * JAVA36 日期换算
     * @param args
     * @throws ParseException
     */
    public static void main4(String[] args) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Scanner in = new Scanner(System.in);
        String str1 = in.nextLine();

        //write your code here......
        String[] arr  = str1.split(" ");
        if (arr.length != 6){
            System.out.println("您输入的数据不合理");
        }else{
            String num = arr[0]+"-"+arr[1]+"-"+arr[2]+" "+arr[3]+":"+arr[4]+":"+arr[5];
            Date date = sdf.parse(num);
            System.out.println("北京时间为："+ sdf.format(date.getTime()));
            System.out.println("纽约时间为："+sdf.format(date.getTime() - (long)12* 60 * 60 * 1000));
            //  System.out.println("北京时间为：" + sdf.format(date.getTime()));
            // System.out.println("纽约时间为：" + sdf.format(date.getTime() - (long)12* 60 * 60 * 1000));

        }

    }

    /**
     * JAVA37 判断学生成绩
     * @param args
     */
    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int score = scanner.nextInt();

        //write your code here......
        try{
            if (score >= 0 && score <= 100){
                System.out.println(score);
            }else{
                throw new ScoreException("分数不合法");//抛出异常
            }

        }
        catch(ScoreException e){
            System.out.println(e.getMessage()); //输出异常
        }
    }
}

class ScoreException extends Exception {//继承自异常类的分数异常处理类

    //write your code here......
    public ScoreException(String message){ //构造函数
        super(message);//输入异常信息
    }

}